package com.d2rv.offscreen;

import com.d2rv.guide.GuideGUI;
import processing.core.PApplet;

/**
 * This class of the offscreen Guide GUI.
 *
 * @author Darrieutort A., Dupouy A., Rossignol L., Van Poucke A.
 */
public class OffScreenGuideGUI extends OffScreen2D {

    private GuideGUI guidegui;

    /**
     *  Default constructor.
     *
     * @param parent the current application
     * @param width the width of the offscreen
     * @param height the height of the offscreen
     */
    public OffScreenGuideGUI(PApplet parent, int width, int height) {
        super(parent, width, height);
        this.guidegui = new GuideGUI(parent, this);
    }

    /**
     *  Calls the draw method of the offscreen guide Gui
     */
    public void draw() {
        beginDraw();
        background(210, 210, 210);
        endDraw();
    }

    /**
     *
     * Calls the show method the guide GUI
     * 
     * @param parent the current application
     * @param x the x coordinate of the left corner of the offscreen
     * @param y the y coordinate of the left corner of the offscreen
     */
    public void show(PApplet parent, int x, int y) {
        parent.image(getTexture(), x, y, this.width, this.height);
        this.guidegui.draw();
    }
    
    /**
     * Returns the guide GUI.
     * @return the guide GUI
     */
    public GuideGUI guidegui(){
        return this.guidegui;
    }
}